//Tue May 24 20:26:21 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class ComplementMachine2D {
public:
	int largestSubmatrix(vector<string> matrix) {
		int M = matrix.size();
		int N = matrix[0].size();
		vector<vector<vector<vector<int> > > > v(M,
				vector<vector<vector<int> > > (N, vector<vector<int> > (M,
						vector<int> (N, -1))));
		int mmax = 0;
		for (int i = 0; i < M; i++)
			for (int j = 0; j < N; j++) {
				int sum = 0;
				int p,q;
				for ( p = 0; p + i < M; p++)
					for (q = 0; q + j < N; q++) {
						sum ^= matrix[p + i][q + j] - '0';
					}
				if (sum == 0) {
					mmax = max(mmax, (p + 1) * (q + 1));
				}
			}
		return mmax;
	}
};

